package data;

import java.util.Observable;
import java.util.Observer;

import javax.swing.JTextArea;

public class ModeleChat implements Observer {

	private int indice;
	private JTextArea jtaChat;
	
	public ModeleChat(JTextArea jtChat)
	{
		jtaChat = jtChat;
		indice = 0;
	}
	
	@Override
	public void update(Observable arg0, Object arg1) {
	
		Chat chat = (Chat)arg0;
		String line;
		while((line = chat.getLine(indice)) != null) {
			jtaChat.append(line);
			indice++;
		}
	}
}
